import java.util.Scanner;

public class TextIssues3 {
    public static void main(String[] args) {
        int count = 3;
        String password = "1234567";
        Scanner scanner = new Scanner(System.in);
        do{
            ui();
            String number = scanner.nextLine();
            if (number.equals(password)){
                System.out.println("登录成功！");
                break;
            }else {
                System.out.println("登录失败，还有"+(count-1)+"次机会");
            }
        }while (--count > 0);
    }
    public static void ui(){
        System.out.println("----------------------------------------------");
        System.out.println("----------------欢迎来到登录界面-----------------");
        System.out.print("请输入密码登录：");
    }
}
